package org.dyndns.opendemogroup.optimizer.selections;

import java.util.Random;

import org.dyndns.opendemogroup.optimizer.IOptimizationProblem;
import org.dyndns.opendemogroup.optimizer.Population;
import org.dyndns.opendemogroup.optimizer.problems.OneMax;
import org.junit.Test;

/**
 * A class to test the class Rank
 */
public class RankTest
{

	/**
	 * Tests the <i>reset</i> method with some sample values for the benefit of
	 * debugging without involving the entire genetic algorithm.
	 */
	@Test
	public void reset_SampleValues ( )
	{
		final int memberSize = 10;
		double probability = 0.5;
		Rank rank = new Rank ( probability );
		Random randomSource = new Random ( 42 );
		final int populationSize = 50;
		Population population = new Population ( populationSize, memberSize );
		IOptimizationProblem problem = new OneMax ( memberSize );
		rank.reset ( randomSource, population, problem );
	}

}
